//
//  FyUILib.h
//  FyUILib
//
//  Created by luoc on 16/2/6.
//  Copyright © 2016年 luoc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "DCRoundSwitch.h"
#import "MBSliderView.h"
#import "SvGifView.h"
@class UIManager;
@class CCommonFunUI;
@class CListElementUI;
@protocol UIAttribute<NSObject>
- (void)SetAttribute:(const char*)pstrName :(const char*)value;
- (CCommonFunUI*)commonFun;
@end

@protocol UIListAttribute<NSObject>
- (void)AddListElement:(CListElementUI*)element;
@end

@protocol UITabAttribute<NSObject>
- (void)AddTabElement:(UIView*)element;
@end

@interface CCommonFunUI : NSObject
+ (UIColor*)getColorValue:(const char*)value;
+ (CGSize)getSizeValue:(const char*)value;
+ (CGRect)getRectValue:(const char*)value;
+ (void)SetFrameOfVertical:(CGRect)frame :(UIView*)parentView;
+ (void)SetFrameOfHorizontal:(CGRect)frame :(UIView*)parentView;
+ (void)SetFrameOfOverlap:(CGRect)frame :(UIView*)parentView;

- (id)initWithDelegateView:(UIView*)view :(UIManager*)pManager;
- (NSString*)name;
- (UIView*)parentView;
- (void)setBackgroundColor:(const char*)value;
- (void)setWidthSet:(BOOL)bWidthSet;
- (void)setHeightSet:(BOOL)bHeightSet;
- (void)setFloat:(BOOL)bFloat;
- (void)setLeft:(CGFloat)f;
- (void)setRight:(CGFloat)f;
- (void)setTop:(CGFloat)f;
- (void)setBottom:(CGFloat)f;
- (void)setMargin:(CGRect)size;
- (void)setAttribute:(const char*)pstrName value:(const char*)value;
- (void)SetManager:(UIManager*)pManager;
- (void)ChangeTextInfo;
- (NSString*)getLanString:(const char*)value;
- (NSString*)getLanString2:(const char*)value;
- (NSString*)getLanString3:(const char*)value;

- (NSString*)getTextTag:(int)tag;


@property(nonatomic, assign, setter=SetManager:) UIManager   *pManagerUI;
@property(nonatomic, setter=setWidthSet:) BOOL   IsWidthSet;
@property(nonatomic, setter=setHeightSet:) BOOL   IsHeightSet;
@property(nonatomic, setter=setFloat:) BOOL   IsFloat;
@property(nonatomic, setter=setLeft:) CGFloat   fLeft;
@property(nonatomic, setter=setRight:) CGFloat   fRight;
@property(nonatomic, setter=setTop:) CGFloat   fTop;
@property(nonatomic, setter=setBottom:) CGFloat   fBottom;
@property(nonatomic, setter=setMargin:) CGRect    szMargin;
@property(nonatomic, assign) UIView    *_delegateView;
@end

@interface CEditUI: UITextField<UIAttribute, UITextFieldDelegate>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CGifUI: SvGifView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CImageUI: UIImageView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CListUI: UITableView<UIAttribute, UIListAttribute, UITableViewDataSource, UITableViewDelegate>
- (id)initWithUIManager:(UIManager*)pManager;
- (void)addSection;
- (BOOL)addValue:(NSString*)name :(NSString*)attr :(NSString*)value :(NSInteger)index;
- (void)removeValue:(NSIndexPath*)indexPath;
- (void)removeAll;
- (NSString*)GetValue:(NSString*)name :(NSString*)attr :(NSInteger)section :(NSInteger)index;
- (CGFloat)getItemHeight;
@end

@interface CListUI2: UITableView<UIAttribute, UIListAttribute, UITableViewDataSource, UITableViewDelegate>
- (id)initWithUIManager:(UIManager*)pManager;
- (BOOL)addValue:(NSString*)name :(NSString*)attr :(NSString*)value :(NSInteger)index;
- (void)setListData:(NSMutableArray*)data;
- (void)setListssHeadData:(NSMutableArray*)data;
@end

@interface CListElementUI : UITableViewCell<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier :(UIManager*)pManager;
- (void)setFlag:(NSInteger)flag;
- (void)setIAccessoryType:(NSInteger)type;
- (void)setISelectType:(NSInteger)type;
@property(nonatomic, setter=setISelectType:) NSInteger   _iSelectType;
@property(nonatomic, setter=setIAccessoryType:) NSInteger   _iAccessoryType;
@property(nonatomic, setter=setFlag:) NSInteger   iFlag;
@end

@interface CLabelUI: UILabel<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CTextUI: UILabel<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CComboUI: UIView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CButtonUI: UIButton<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CSwitchUI: DCRoundSwitch<UIAttribute, DCRoundSwitchDelegate>
- (id)initWithUIManager:(UIManager*)pManager;
- (void)TheButtonIsPress:(BOOL)on WithSwithTag:(int)tag;
@end

@interface COptionUI: UIView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
- (void)setSelected:(BOOL)bSelected;
- (BOOL)isSelected;
- (void)setTag:(NSInteger)t;
@property(nonatomic,getter=isSelected,setter=setSelected:) BOOL selected;
@property(nonatomic, setter=setTag:) NSInteger   tag;
@end

@interface CSliderUI: UISlider<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CMBSliderUI: MBSliderView<UIAttribute, MBSliderViewDelegate>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CNumberUI: UIView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CControlUI: UIView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CTimeUI: UIView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CProgressUI: UIProgressView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CRichEditUI: UIView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CDateUI: UIView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CContainerUI: UIView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CTabLayoutUI: UIView<UIAttribute, UITabAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
- (void)SelectIndex:(int)index;
@end

@interface CScrollViewUI: UIScrollView<UIAttribute, UIScrollViewDelegate>
- (id)initWithUIManager:(UIManager*)pManager;
@end

@interface CLayoutUI: UIView<UIAttribute>
- (id)initWithUIManager:(UIManager*)pManager;
- (void)setTag:(NSInteger)t;
@property(nonatomic, setter=setTag:) NSInteger   tag;
@end





